
import { Store, getStore } from "@tauri-apps/plugin-store";
import { selectZiLiaoByTit } from "./dbUtils";
let zlList = [
  {
    title: "《六壬三传法详解》 ",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬毕法案录》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬辨疑》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬管辂神书》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬括囊赋》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬类集》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬灵觉经》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬秘本》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬苗公射覆鬼撮脚》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬说约》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬玉藻金英》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《黄帝龙首经》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬存验》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬古占课考》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬五变中黄经》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬粹言》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬辑要启蒙》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬金铰剪》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬经纬》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬论命秘要》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬神定经》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬银河櫂》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬直指御定》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《壬归》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《壬学琐记》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬明鉴》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬探原》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬集成五要权衡》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬断案》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷二",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷三",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷四",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷五",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷六",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷七",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷八",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷九",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷十",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷十一",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬大全》卷十二",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《御定六壬直指》甲戌旬",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《御定六壬直指》甲申旬",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《御定六壬直指》甲午旬",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《御定六壬直指》甲辰旬",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《御定六壬直指》甲寅旬",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬军帐赋》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬神课金口诀古本》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬神课金口诀古本》卷之中",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬神课金口诀古本》卷之下",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬视斯》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬指南》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬指南》卷二  大六壬九天玄女指掌赋",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬指南》卷三 大六壬会纂占验指南",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬指南》卷四 大六壬神煞指南",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《一字玉连环》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬辨疑》卷二",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬辨疑》卷三",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬辨疑》卷四",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬辨疑》卷五",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬说约》卷中",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬说约》卷下",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬说约》卷末",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《壬窍》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《六壬运移经》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "软件使用帮助",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "六壬东方朔射覆",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "太上感应篇",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "六十四课经",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
  {
    title: "《大六壬心境》",
    rdPercent: 0,
    shouCang: false,
    rdCount: 0,
    zhiDing: false,
  },
];
async function getLRZLList() {
//   const store = await Store.load("data.bin");
//   let zlt = await store.get("zlList");
//   if (zlt == undefined || zlt == null) {
//     allZL.forEach((item) => {
//       zlList.push({ title: item.title, rdPercent: 0 });
//     });
//   } else {
//     await store.set("zlList", zlList);
//   }

  return zlList;
}
async function getCurrentBook(tit) {
  let allZL = await selectZiLiaoByTit(tit)
    
  return allZL;
}
function getBookRdP(tit) {
  let zl = zlList.find(item => item.title == tit)
  return zl.rdPercent
}
export { getLRZLList, getCurrentBook,getBookRdP };

